﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Collections;

namespace PeachLite.Entity
{
    /// <summary>
    /// 系统消息类
    /// </summary>
    public class SysResult
    {
        /// <summary>
        /// 消息代码
        /// </summary>
        public int Code;

        /// <summary>
        /// 消息内容
        /// </summary>
        public string Message;

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success;

        /// <summary>
        /// 数据
        /// </summary>
        public Hashtable Data;

        /// <summary>
        /// 数据
        /// </summary>
        public DataSet DSet;

        /// <summary>
        /// 异常
        /// </summary>
        public Exception Exception { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        public SysResult()
        {
            Code = -1;
            Message = "";
            Success = false;
            Data = new Hashtable();
            Exception = null;
        }

        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="code">代码</param>
        /// <param name="message">消息</param>
        public SysResult(int code, string message)
        {
            Success = code == 0;
            Code = code;
            Message = message;
            Data = new Hashtable();
            Exception = null;
        }
    }
}